﻿using System;

namespace nHydrate.EFCore.DataAccess
{
	/// <summary>
	/// 
	/// </summary>
	/// <typeparam name="R"></typeparam>
	/// <typeparam name="E"></typeparam>
	public class AuditResultFieldCompare<R, E> : IAuditResultFieldCompare
	{
		public AuditResultFieldCompare(R value1, R value2, E field, System.Type dataType)
		{
			this.Field = field;
			this.Value1 = value1;
			this.Value2 = value2;
			this.DataType = dataType;
		}

		/// <summary>
		/// 
		/// </summary>
		public E Field { get; internal set; }
		/// <summary>
		/// 
		/// </summary>
		public R Value1 { get; internal set; }
		/// <summary>
		/// 
		/// </summary>
		public R Value2 { get; internal set; }

		/// <summary>
		/// 
		/// </summary>
		public System.Type DataType { get; internal set; }

		#region IAuditResultFieldCompare

		System.Enum IAuditResultFieldCompare.Field
		{
			get { return (System.Enum)Enum.Parse(typeof(E), this.Field.ToString()); }
		}

		object IAuditResultFieldCompare.Value1
		{
			get { return this.Value1; }
		}

		object IAuditResultFieldCompare.Value2
		{
			get { return this.Value2; }
		}

		#endregion

	}
}
